package com.leadership.entity.actionlearning;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.leadership.entity.user.User;

/**
 * 刻意行动计划总结
 * 
 * @author mohanlan
 *
 */
@Entity
@Table(name = "action_learning_comment")
public class ActionLearningComment {
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    
    /** 所属人 */
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private User user;
    
    /**
     * 所属刻意学习计划表
     */
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private ActionLearning actionLearning;
    
    /**
     * 感悟与收获
     */
    @Column(length=9000)
    private String comment;
    
    /**
     * 下阶段重点提升的方向
     */
    @Column(length=9000)
    private String description;
    
    private Date createTime;
    
    @Column(name = "is_disabled")
    private boolean disabled;
    
    public ActionLearningComment() {
    }
    
    /**
     * 
     * @param actionLearning
     * @param user
     * @return
     */
    public ActionLearningComment initilization(ActionLearning actionLearning, User user) {
        this.user = user;
        this.actionLearning = actionLearning;
        this.createTime = new Date();
        this.disabled = false;
        return this;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the user
     */
    public User getUser() {
        return user;
    }

    /**
     * @return the actionLearning
     */
    public ActionLearning getActionLearning() {
        return actionLearning;
    }

    /**
     * @return the comment
     */
    public String getComment() {
        return comment;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the createTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param user the user to set
     */
    public void setUser(User user) {
        this.user = user;
    }

    /**
     * @param actionLearning the actionLearning to set
     */
    public void setActionLearning(ActionLearning actionLearning) {
        this.actionLearning = actionLearning;
    }

    /**
     * @param comment the comment to set
     */
    public void setComment(String comment) {
        this.comment = comment;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @param createTime the createTime to set
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }
}
